<template>
  <div class="index-container">
    <el-container>
			<el-aside>
				<el-menu
					class="el-menu-vertical-demo"
					background-color="#545c64"
					text-color="#fff"
					active-text-color="#ffd04b"
					router
				>
          <el-submenu v-for="(menu,index) in menuList" :key="index" :index="JSON.stringify(menu.sort)">
            <template #title>
              <i :class="menu.icon"></i>
              <span>{{menu.name}}</span>       
            </template>
            <div v-if="menu.childMenus.length > 0">
              <el-menu-item v-for="child in menu.childMenus" :key="child.code" :index="child.path">
                <i :class="child.icon"></i>
                {{child.name}}
              </el-menu-item>
            </div>
          </el-submenu>
				</el-menu>
			</el-aside>
			<el-container>
				<el-header>书籍管理系统(测试使用)</el-header>
				<el-main>
					<router-view/>
				</el-main>
				<el-footer>Footer</el-footer>
			</el-container>
			
    </el-container>
  </div>
</template>

<script>
import systemMenus from './others/SystemMenuConfigMock'
export default {
  data(){
    return {
      menuList: systemMenus,
      isCollapse: true
    }
  },
  methods: {
  }

}
</script>

<style scoped>
.index-container, .el-container{
	width: 100%;
	height: 100%;
}
.el-header, .el-footer {
	background-color: #B3C0D1;
	color: #333;
	text-align: center;
	line-height: 60px;
}
  
.el-aside {
	background-color: #D3DCE6;
	color: #333;
	/* overflow-y: scroll; */
	overflow-x: hidden;
}

.el-main {
	background-color: #E9EEF3;
	color: #333;
}

body > .el-container {
	margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
	line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
	line-height: 320px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
	width: 100%;
}

.el-menu{
	width: 100%;
	height: 100%;
}
</style>